﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.CarService.Illegals;
using TianShiProject.Models.Common;
using Volo.Abp.Application.Services;

namespace TianShiProject.CarService.Illegals
{
    public class IllegalService : ApplicationService
    {
        private readonly IIllegalRepository _illegalRepository;
        public IllegalService(IIllegalRepository illegalRepository)
        {
            _illegalRepository = illegalRepository;
        }
        /// <summary>
        /// 显示违章记录
        /// </summary>
        /// <param name="name"></param>
        /// <param name="time"></param>
        /// <param name="cardnumber"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<IllegalDto>> GetShowIllegal(string name, DateTime? time, string cardnumber, int pageindex = 1, int pagesize = 3)
        {
            return await _illegalRepository.GetShowIllegal(name, time, cardnumber, pageindex, pagesize);
        }
        /// <summary>
        /// 删除违章记录
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelIllegal(int id)
        {
            return await _illegalRepository.DeleteDelIllegal(id);
        }
        /// <summary>
        /// 批量删除违章记录
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelsIllegal(string ids)
        {
            return await _illegalRepository.DeleteDelsIllegal(ids);
        }
        /// <summary>
        /// 编辑修改
        /// </summary>
        /// <param name="illegalDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdateIllegal(IllegalDto illegalDto)
        {
            return await _illegalRepository.PutUpdateIllegal(illegalDto);
        }
        /// <summary>
        /// 添加违章记录
        /// </summary>
        /// <param name="illegalDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddIllegal(IllegalDto illegalDto)
        {
            return await _illegalRepository.PostAddIllegal(illegalDto);
        }
    }
}
